﻿using System;
using System.Xml.Linq;
using Common.Constants;
using Common.Helper;
using Common.Interface;

namespace MainProcessor.Processors
{
    public class ChildProcessor : IChild
    {
        public ChildProcessor(XElement childNode, XElement parent)
        {
            BaseElement = childNode;
            Parent = parent;
        }

        private XElement Parent { get; set; }
        public XElement BaseElement { get; private set; }
        

        public bool IsEmpty
        {
            get { return TopElement.IsEmpty; }
        }


        public bool HasParent
        {
            get { return Parent != default(XElement); }
        }

        public XElement TopElement
        {
            get
            {
                return HasParent ? Parent : BaseElement;
            }
        }

       
        
    }
}
